package com.yjq.dao.impl;

import com.yjq.dao.BaseDao;
import com.yjq.dao.RectangleDao;
import com.yjq.pojo.Rectangle;

import java.util.List;

/**
 * @author 尹嘉琪
 * @create 2021-12-23 0:41
 */
public class RectangleDaoImpl extends BaseDao implements RectangleDao {
    @Override
    public int insertRectangle(Rectangle rectangle) {
        String sql = "insert into rectangle(width,height,shape) values (?,?,?)";
        return update(sql,rectangle.getWidth(), rectangle.getHeight(), rectangle.getShape());
    }

    @Override
    public List<Rectangle> queryListForAll() {
        String sql = "select width,height,shape from rectangle";
        return queryForList(Rectangle.class, sql);
    }
}
